public class Test
{
	private static int RANDOM_TESTS = 10;
	
	private static void testRandom(ILaby lab)
	{
		int tot=0, ct;
		Robot rob = new RobotAleatoire(lab);
		System.out.println("* Random");
		for (int i=1; i<=RANDOM_TESTS; i++)
		{
			tot += (ct = rob.findExit());
			System.out.println("Test "+i+": "+ct+" moves");
			lab.reset();
		}
		System.out.println("Average: "+(double)tot/RANDOM_TESTS+" moves");
	}
	
	private static void testRobot(HistorizedLaby lab, Robot rob, String descr)
	{
		System.out.println("* "+descr);
		rob.findExit();
		lab.displayMoves();
		lab.reset();
	}

	public static void main(String[] args)
	{
		ILaby lab = Labyrinthe.laby1();
		HistorizedLaby lab2 = new HistorizedLaby((Labyrinthe)lab);
		
		System.out.println("* Labyrinth");
		lab.affichage();
		
		// testRandom(lab);
		// testRobot(lab2, new RobotIA(lab2), "AI");
		testRobot(lab2, new RobotBest(lab2), "Best");
	}
}
